package cn.steel.service;

import cn.steel.domain.dto.InventoryUpdateDto;
import cn.steel.domain.dto.OrderDto;
import cn.steel.domain.entity.Order;
import cn.steel.domain.vo.OrderDetailVo;
import cn.steel.domain.vo.OrderListVo;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface OrderService {
    List<Order> findOrdersByBuyerId(Long buyerId);

    long countOrdersBySupplierId(Long supplierId);
    Order createOrder(OrderDto orderDto);


    /**
     * 获取订单详情
     * @param orderNo 订单号
     * @param userId 用户ID
     * @return 订单详情
     */
    OrderDetailVo getOrderDetail(String orderNo, Long userId);
    /**
     * 支付订单
     * @param orderNo 订单号
     * @param userId 用户ID
     * @return 是否支付成功
     */

    boolean cancelOrder(String orderNo, Long userId);
    boolean confirmReceipt(String orderNo, Long userId);
    List<OrderListVo> getSupplierOrderList(Long supplierId, String status, String orderNo);
    OrderDetailVo getSupplierOrderDetail(String orderNo, Long supplierId);
    boolean shipOrder(String orderNo, String shippingCompany, String trackingNumber, String shippingAddress,Long supplierId);

    PageInfo<OrderListVo> getPagedOrderList(Long userId, String status, int pageNum, int pageSize);

    PageInfo<OrderListVo> getSupplierOrderList(Long supplierId, String status, String orderNo, int pageNum, int pageSize);

    void deleteOrder(String orderNo);

    void deleteSupplierOrder(String orderNo, Long supplierId);

    /**
     * 更新库存(减少)
     * @param dto 库存更新DTO
     * @return 是否更新成功
     */
    boolean reduceInventory(InventoryUpdateDto dto);

}